<?php

namespace Common\Model;
use Think\Model\RelationModel;

/**
 * 收藏模型
 */
class CollectModel extends RelationModel{
    
    protected $_link = array(
        'Product' => array(
            'mapping_type' => self::BELONGS_TO,
            'class_name' => 'Product',
            'foreign_key' => 'tid',
            'mapping_name' => 'product',
            'mapping_fields' => 'pname,pic,price,collect,id',
            'as_fields' => 'pname,pic,price,collect,id:pid'
        ),
        'Store' => array(
            'mapping_type' => self::BELONGS_TO,
            'class_name' => 'Store',
            'foreign_key' => 'tid',
            'mapping_name' => 'store',
            'mapping_fields' => 'sname,pic,lon,lat,bid',
            'as_fields' => 'sname,pic,lon,lat,bid'
        ),
        'Designer' => array(
            'mapping_type' => self::BELONGS_TO,
            'class_name' => 'Designer',
            'foreign_key' => 'tid',
            'mapping_name' => 'designer',
            'mapping_fields' => 'dname,pic,job,feature,phone,content,status,cover',
            'as_fields' => 'dname,pic,job,feature,phone,content,status,cover'
        ),
        'Works' => array(
            'mapping_type' => self::BELONGS_TO,
            'class_name' => 'Works',
            'foreign_key' => 'tid',
            'mapping_name' => 'works',
            'mapping_fields' => 'wname,pic,explain,content,id',
            'as_fields' => 'wname,pic,explain,content,id:wid'
        )
    );

}

?>
